From: Ian Campbell Date: Tue, 24 May 2011 17:22:23 +0000 (+0100) Subject: tools: libxl: constify parameter to libxl__abs_path X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10303 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=35d01184de6af2213de5a5cbf4e0d96d6380eb51;p=xen.git tools: libxl: constify parameter to libxl__abs_path Signed-off-by: Ian Campbell Acked-by: Ian Jackson Committed-by: Ian Jackson --- diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c index 046e4435c7..f1e0daa1da 100644 --- a/tools/libxl/libxl_internal.c +++ b/tools/libxl/libxl_internal.c @@ -184,10 +184,10 @@ void libxl__log(libxl_ctx *ctx, xentoollog_level msglevel, int errnoval, va_end(ap); } -char *libxl__abs_path(libxl__gc *gc, char *s, const char *path) +char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path) { if (!s || s[0] == '/') - return s; + return libxl__strdup(gc, s); return libxl__sprintf(gc, "%s/%s", path, s); } diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index b032e7fa8e..babc44a3a2 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -309,7 +309,7 @@ _hidden void libxl__exec(int stdinfd, int stdoutfd, int stderrfd, _hidden void libxl__log_child_exitstatus(libxl__gc *gc, const char *what, pid_t pid, int status); -_hidden char *libxl__abs_path(libxl__gc *gc, char *s, const char *path); +_hidden char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path); #define LIBXL__LOG_DEBUG XTL_DEBUG #define LIBXL__LOG_INFO XTL_INFO